#pragma comment(lib,"d3d9.lib")
#pragma comment(lib,"d3dx9.lib")
const float WINDOW_WIDTH = GetSystemMetrics(SM_CXSCREEN)-50;
const float WINDOW_HEIGHT = GetSystemMetrics(SM_CYSCREEN)-50;
LPDIRECT3D9 d3d;
LPDIRECT3DDEVICE9 d3ddev;
LPDIRECT3DVERTEXBUFFER9 vertexBuffer;

#define CUSTOMFVF (D3DFVF_NORMAL|D3DFVF_XYZ|D3DFVF_TEX1)
struct CUSTOMVERTEX { float x, y, z; float nx, ny, nz; float u, v; };
#define CAMERAMOVE 0.2f
D3DLIGHT9 lightPoint;
D3DLIGHT9 lightDirection;
D3DLIGHT9 lightSpot;

LPD3DXFONT font;
RECT fontRect;
int isLight = 1;
float rotate = 0.0f;
float tx = 0.0f, ty = 0.0f, tz = 0.0f;
//material
D3DMATERIAL9 mtrlFloor;
D3DMATERIAL9 mtrlWall;
D3DMATERIAL9 mtrlMirror;
D3DMATERIAL9 mtrlCube;
LPD3DXMESH a;
//tex
LPDIRECT3DTEXTURE9 texFloor;
LPDIRECT3DTEXTURE9 texWall;
LPDIRECT3DTEXTURE9 texMirror;
LPDIRECT3DTEXTURE9 texCube;
LPDIRECT3DTEXTURE9 texWallBack;

float cx = 0, cy = 4, cz = 10;
float ux = 0, uy = 0, uz = 0;
float vux = 0, vuy = 0, vuz = 0;